package com.wlyuan.index.application.translator;

import com.wlyuan.index.api.vo.OrderIndexScrollVO;
import com.wlyuan.index.api.vo.OrderIndexVO;
import com.wlyuan.index.domain.index.OrderIndex;
import com.wlyuan.index.domain.index.OrderIndexScroll;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

public class OrderIndexTranslator {
    @Mapper
    public interface Translator {
        OrderIndexScrollVO translate(OrderIndexScroll source);

        OrderIndexVO translate(OrderIndex source);
    }

    private static final Translator TRANSLATOR = Mappers.getMapper(Translator.class);

    public static OrderIndexScrollVO translate(OrderIndexScroll source) {
        return TRANSLATOR.translate(source);
    }

    public static OrderIndexVO translate(OrderIndex source) {
        return TRANSLATOR.translate(source);
    }
}
